<?php

declare(strict_types=1);

namespace App\CustHub\Model;

use Mine\MineModel;

/**
 * @property int $id 
 * @property int $uid 用户ID
 * @property string $order_no 订单编号
 * @property string $total_amount 订单总金额
 * @property string $pay_amount 支付金额
 * @property string $discount 优惠金额
 * @property int $pay_way 支付方式：0=余额 1=微信 2=支付宝
 * @property string $remark 备注信息
 * @property int $status 订单状态：0=待支付 1=已完成 2=已取消
 * @property string $transaction_id 支付单号
 * @property string $pay_time 支付时间
 * @property array $ext 扩展参数
 * @property int $order_type 订单类型
 * @property int $is_use_balance 是否使用余额：0=否 1=是
 * @property string $balance 余额
 * @property \Carbon\Carbon $created_at 创建时间
 * @property \Carbon\Carbon $updated_at 更新时间
 */
class ChOrder extends MineModel
{
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'ch_order';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'uid', 'order_no', 'total_amount', 'pay_amount', 'discount', 'pay_way', 'remark', 'status', 'transaction_id', 'pay_time', 'ext', 'order_type', 'is_use_balance', 'balance', 'created_at', 'updated_at'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'uid' => 'integer', 'total_amount' => 'decimal:2', 'pay_amount' => 'decimal:2', 'discount' => 'decimal:2', 'pay_way' => 'integer', 'status' => 'integer', 'ext' => 'array', 'order_type' => 'integer', 'is_use_balance' => 'integer', 'balance' => 'decimal:2', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
}
